<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<IEnumerable<PSAdmin.Core.Security.UserRole>>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
	User Roles
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <div class="span-12">
        <h2>User Roles</h2>
    </div>
    <div class="span-12 right last">
        <%if (User.IsInRole("Administrators")) { %>
            <%=Html.ActionLink("Create new role", "CreateRole") %>
        <%} %>
    </div>
    <table>
        <thead>
            <tr>
                <th>Role Name</th>
                <th>Number of users</th>
                <th></th>
            </tr>
        </thead>
        <tbody>
            <%foreach (var role in Model) { %>
            <tr>
                <td><%=Html.Encode(role.Name) %></td>
                <td><%=role.NumberOfUsers%></td>
                <td><%=Html.ActionLink("Edit", "EditRole", new { id = role.Id }) %></td>
            </tr>
            <%} %>
        </tbody>
    </table>
</asp:Content>
